package com.hnevc.exam4zhangsan;



import java.util.ArrayList;

import java.util.List;



import okhttp3.Cookie;

import okhttp3.CookieJar;

import okhttp3.HttpUrl;



/**

 * Created by Administrator on 2017/12/15.

 */


class MyCookieJar implements CookieJar {

    //使用静态变量维护Cookie

    public static List<Cookie> sCookies = new ArrayList<>();

    @Override

    public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {

        sCookies = cookies;

    }



    @Override

    public List<Cookie> loadForRequest(HttpUrl url) {

        return sCookies;

    }

}
